package net.swordie.ms.client.guild.result;

import java.util.Arrays;

/**
 * Created on 3/21/2018.
 */
public enum GuildType {
    Req_LoadGuild(0),
    Req_FindGuildByCid(1),
    Req_FindGuildByGID(2),
    Req_InputGuildName(3),
    Req_CheckGuildName(4),
    Req_CreateGuildAgree(5),
    Req_CreateNewGuild(6),
    Req_InviteGuild(7),
    Req_JoinGuild(8),
    Req_JoinGuildDirect(9),
    Req_UpdateJoinState(10),
    Req_WithdrawGuild(11),
    Req_KickGuild(12),
    Req_RemoveGuild(13),
    Req_IncMaxMemberNum(14),
    Req_ChangeLevel(15),
    Req_ChangeJob(16),
    Req_SetGuildName(17),
    Req_SetGradeName(18),
    Req_SetMemberGrade(19),
    Req_SetMark(20),
    Req_SetNotice(21),
    Req_InputMark(22),
    Req_CheckQuestWaiting(23),
    Req_CheckQuestWaiting2(24),
    Req_InsertQuestWaiting(25),
    Req_CancelQuestWaiting(26),
    Req_RemoveQuestCompleteGuild(27),
    Req_IncPoint(28),
    Req_IncCommitment(29),
    Req_DecGGP(30),
    Req_DecIGP(31),
    Req_SetQuestTime(32),
    Req_ShowGuildRanking(33),
    Req_SetSkill(34),
    Req_SkillLevelSetUp(35),
    Req_ResetGuildBattleSkill(36),
    Req_UseActiveSkill(37),
    Req_UseADGuildSkill(38),
    Req_ExtendSkill(39),
    Req_ChangeGuildMaster(40),
    Req_FromGuildMember_GuildSkillUse(41),
    Req_SetGGP(42),
    Req_SetIGP(43),
    Req_BattleSkillOpen(44),
    Req_Search(45),
    Req_CreateNewGuild_Block(46),
    Req_CreateNewAlliance_Block(47),
    Req_ChatN_FindGuildIDByCID(48),


    Res_LoadGuild_Done(49),
    Res_FindGuild_Done(50),
    Res_CheckGuildName_Available(51),
    Res_CheckGuildName_AlreadyUsed(52),
    Res_CheckGuildName_Unknown(53),
    Res_CreateGuildAgree_Reply(54),
    Res_CreateGuildAgree_Unknown(55),
    Res_CreateNewGuild_Done(56),
    Res_CreateNewGuild_AlreadyJoined(57),
    Res_CreateNewGuild_GuildNameAlreayExist(58),
    Res_CreateNewGuild_Beginner(59),
    Res_CreateNewGuild_Disagree(60),
    Res_CreateNewGuild_NotFullParty(61),
    Res_CreateNewGuild_Unknown(62),
    Res_JoinGuild_Done(63),
    Res_JoinGuild_AlreadyJoined(64),
    Res_JoinGuild_AlreadyFull(65),
    Res_JoinGuild_UnknownUser(66),
    Res_JoinGuild_NonRequestFindUser(67),
    Res_JoinGuild_Unknown(68),
    Res_JoinRequest_Done(69),
    Res_JoinRequest_DoneToUser(70),
    Res_JoinRequest_AlreadyFull(71),
    Res_JoinRequest_LimitTime(72),
    Res_JoinRequest_Unknown(73),
    Res_JoinCancelRequest_Done(74),
    Res_WithdrawGuild_Done(75),
    Res_WithdrawGuild_NotJoined(76),
    Res_WithdrawGuild_Unknown(77),
    Res_KickGuild_Done(78),
    Res_KickGuild_NotJoined(79),
    Res_KickGuild_Unknown(80),
    Res_RemoveGuild_Done(81),
    Res_RemoveGuild_NotExist(82),
    Res_RemoveGuild_Unknown(83),
    Res_RemoveRequestGuild_Done(84),
    Res_InviteGuild_BlockedUser(85),
    Res_InviteGuild_AlreadyInvited(86),
    Res_InviteGuild_Rejected(87),
    Res_AdminCannotCreate(88),
    Res_AdminCannotInvite(89),
    Res_IncMaxMemberNum_Done(90),
    Res_IncMaxMemberNum_Unknown(91),
    Res_ChangeMemberName(92),
    Res_ChangeRequestUserName(93),
    Res_ChangeLevelOrJob(94),
    Res_NotifyLoginOrLogout(95),
    Res_SetGradeName_Done(96),
    Res_SetGradeName_Unknown(97),
    Res_SetMemberGrade_Done(98),
    Res_SetMemberGrade_Unknown(99),
    Res_SetMemberCommitment_Done(100),
    Res_SetMark_Done(101),
    Res_SetMark_Unknown(102),
    Res_SetNotice_Done(103),
    Res_InsertQuest(104),
    Res_NoticeQuestWaitingOrder(105),
    Res_SetGuildCanEnterQuest(106),
    Res_IncPoint_Done(107),
    Res_ShowGuildRanking(108),
    Res_SetGGP_Done(109),
    Res_SetIGP_Done(110),
    Res_GuildQuest_NotEnoughUser(111),
    Res_GuildQuest_RegisterDisconnected(112),
    Res_GuildQuest_NoticeOrder(113),
    Res_Authkey_Update(114),
    Res_SetSkill_Done(115),
    Res_SetSkill_Extend_Unknown(116),
    Res_SetSkill_LevelSet_Unknown(117),
    Res_SetSkill_ResetBattleSkill(118),
    Res_UseSkill_Success(119),
    Res_UseSkill_Err(120),
    Res_ChangeName_Done(121),
    Res_ChangeName_Unknown(122),
    Res_ChangeMaster_Done(123),
    Res_ChangeMaster_Unknown(124),
    Res_BlockedBehaviorCreate(125),
    Res_BlockedBehaviorJoin(126),
    Res_BattleSkillOpen(127),
    Res_GetData(128),
    Res_Rank_Reflash(129),
    Res_FindGuild_Error(130),
    Res_ChangeMaster_Pinkbean(131),
    ;

    private byte val;

    GuildType(int val) {
        this.val = (byte) val;
    }

    public static GuildType getTypeByVal(byte val) {
        return Arrays.stream(values()).filter(grt -> grt.getVal() == val).findAny().orElse(null);
    }

    public byte getVal() {
        return val;
    }
}
